package com.csy.user.entity.system.service.impl;

import com.csy.user.entity.system.domain.SysNotice;
import com.csy.user.entity.system.mapper.SysNoticeMapper;
import com.csy.user.entity.system.service.SysNoticeService;

import io.seata.spring.annotation.GlobalTransactional;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class SysNoticeServiceImpl implements SysNoticeService {

    @Resource
    private SysNoticeMapper sysNoticeMapper;

    @Override
    public List<SysNotice> selectNoticeList(SysNotice sysNotice) {
        return sysNoticeMapper.selectNoticeList(sysNotice);
    }


    @Override
    public SysNotice selectNoticeById(Long noticeId) {
        return sysNoticeMapper.selectById(noticeId);
    }

    @Override
    @GlobalTransactional
    public int addNotice(SysNotice sysNotice) {

        return sysNoticeMapper.insert(sysNotice);
    }

    @Override
    @GlobalTransactional
    public int update(SysNotice sysNotice) {
        return sysNoticeMapper.updateById(sysNotice);
    }

    @Override
    @GlobalTransactional
    public int deleteById(String id) {
        return sysNoticeMapper.deleteById(id);
    }
}
